home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / oad11.zip / ONEADAY.DOC < prev    next >
Text File  |  1991-06-26  |  7KB  |  153 lines

  1. ONEADAY.EXE Version 1.1 - Copyright (c) 1991 by James J. Murphy
  2.  
  3. FUNCTION
  4. If you have a need to run a particular program once a day, once a
  5. week, or once a month, or perform daily, weekly, or monthly BBS
  6. functions, then ONEADAY is for you.  ONEADAY is meant to be executed
  7. by a batch file, in most cases from AUTOEXEC.BAT, but it is also
  8. useful in the batch files that run BBS software.  ONEADAY will execute
  9. a special batch file either once per day, once per month, or on any
  10. specified day of the week, or all three.  The special batch file then
  11. executes your designated programs.
  12.  
  13. WARNING
  14. First off, you must know that this program will not function if you
  15. attempt to make it a compressed executable using programs like PKLITE
  16. ir LZEXE, or if you rename it.  This is because it writes back to
  17. itself, and if you rename it, it will not be able to find the file,
  18. and if you compress it, it will not be able to locate the special
  19. 'flag' bytes that it searches for, to know where within itself to
  20. write the data.
  21.  
  22. ONEADAY defaults to executing a special BATCH or BTM (4DOS Batch) file
  23. once a day, when it is executed.  The name of this file is OAD.BAT or
  24. OAD.BTM (it also looks for OAD.BTM if executed in a 4DOS environment),
  25. and it cannot be renamed.
  26.  
  27.   USAGE: ONEADAY [D] [M] [0|1|2|3|4|5|6] [OAD-Path]
  28.    or    ONEADAY RESET
  29.    or    ONEADAY <Enter>  for a Help screen.
  30.  
  31. The D parameter instructs ONEADAY to execute OAD.BAT/BTM once a day,
  32. the first time it is run.
  33.  
  34. The M parameter tells ONEADAY to run OAD.BAT/BTM once a month, the
  35. first time it is executed in a new month.
  36.  
  37. The 0 to 6 paramenters indicate what day during the week you want
  38. OAD.BAT/BTM executed.  0=Sunday, 1=Monday, etc.  You may specify more
  39. than one day during the week, up to all 7 days.
  40.  
  41. The OAD-Path parameter tells the program where to find the batch file,
  42. and has to end with a trailing backslash.  If you happen to have the
  43. OAD batch file located in a directory listed in your PATH
  44. environmental variable, or you are located in the same directory as
  45. OAD, then the OAD-Path parameter is not necessary.
  46.  
  47. The RESET parameter is used when testing ONEADAY.EXE and it refuses to
  48. execute OAD.BAT/BTM again.  Just run ONEADAY with the RESET parameter,
  49. and the program will reset the daily, weekly, and monthly data in
  50. itself, allowing you to test it again.
  51.  
  52. Executing ONEADAY with no parameters will give you a help screen.
  53.  
  54. To execute OAD.BAT/BTM once monthly, once per day, and also on Sunday,
  55. Tuesday, and Wednesday, and giving the path to the batch file, you
  56. would enter the following.
  57.  
  58.   ONEADAY D 032 c:\path\ M
  59. or
  60.   ONEADAY \batch\ m 320 d
  61.  
  62. The order of the parameters is not important.  The paths shown are
  63. just examples, substitute your paths there.
  64.  
  65. To execute OAD.BAT/BTM only on Monday and Thursday, you would enter
  66. the following.
  67.  
  68.   ONEADAY 14
  69.  
  70. Even though ONEADAY itself might be executed more than once a day, the
  71. special batch file OAD.BAT/BTM is only executed on the days specified,
  72. and only once.
  73.  
  74. ONEADAY passes special parameters to the OAD batch file which makes
  75. sure that the daily, weekly, and monthly actions are only executed on
  76. the days specified.
  77.  
  78. You must add the names of programs you want executed into the
  79. OAD.BAT/BTM file using a text editor.  Examine the sample OAD.BAT file
  80. to see where to add your program names, it is commented to assist you.
  81.  
  82. In order for ONEADAY to write data back to itself, it must know where
  83. ONEADAY.EXE is located.  If you execute it within the same directory
  84. where it is located, or in a directory listed in your PATH
  85. evironmental variable, then there is no problem.  But if you execute
  86. it anywhere else, you would have to set an environmental variable
  87. called OAD specifying the path to ONEADAY.EXE.  You would normally set
  88. this variable in your AUTOEXEC.BAT file BEFORE you execute the ONEADAY
  89. program itself.  This path has to end with a trailing backslash.  An
  90. example of setting the environmental variable OAD is as follows.
  91.  
  92.   set OAD=C:\UTILITY\
  93.  
  94. You can achieve the fastest execution of this program by locating it,
  95. and OAD in the same directory you execute it from, OR by setting the
  96. environmental variable OAD to the path to ONEADAY.EXE, and also
  97. specifying the path to OAD.BAT/BTM as a parameter when executing
  98. ONEADAY.  The program then doesn't have to search each directory of
  99. your PATH list.  This program always looks for OAD.BAT first, and if
  100. in a 4DOS environment, then looks for OAD.BTM.  So if you are running
  101. under 4DOS and you have both BAT and BTM files in the same directory,
  102. it will never execute OAD.BTM.  If you should happen to have more than
  103. one copy of ONEADAY.EXE in your path, you might experience strange
  104. results if it locates the wrong file when writing back to itself.
  105.  
  106. HOW IT WORKS
  107. There are 3 bytes within ONEADAY.EXE that are set to ASCII 32 when the
  108. program was compiled (or if you run ONEADAY with the RESET parameter).
  109. If ONEADAY is set to execute OAD.BAT/BTM daily, then the first of the
  110. 3 bytes is overwritten with todays day of the month number which will
  111. be a 1 to 31.  If ONEADAY is executed again the same day, it compares
  112. the stored number with todays number, and if it is the same, does
  113. nothing.  The next byte is used for the weekly execution of OAD, and
  114. it contains the day of the month number that ONEADAY executes OAD for
  115. a weekly event, and the last byte contains the month number.  When
  116. testing ONEADAY, and you want the program to execute OAD again, just
  117. type ONEADAY RESET, to restore the programs internal data, which
  118. allows you to test it again.
  119.  
  120. TESTING ONEADAY
  121. You can test out ONEADAY by placing it and the sample OAD.BAT file in
  122. the same directory, and then run ONEADAY from the same directory,
  123. passign it a 'D' parameter first, then a 'M' parameter, and finally
  124. the day number as a parameter (Sunday=0, Monday=1, etc.).  Then run it
  125. three more times again, and notice that nothing happens this time. The
  126. first time the OAD.BAT file echoes the type of parameter that was
  127. passed to it, and during the second test nothing happens.  Now type
  128. 'ONEADAY RESET <Enter>', and try out some combinations of your own, to
  129. gain confidence in the program.  There are rare instances when the
  130. program may fail, such as only running ONEADAY with an 'M' (monthly)
  131. parameter, during the same month each year.  It would then just
  132. execute the first time then never again.  The same rare conditions can
  133. also exist for the 'D' (daily), and the '0-6' (weekly) parameters, but
  134. if you use your computer several times a month, you should not have
  135. any problems.
  136.  
  137. This program is free, and it may be copied, and passed around freely
  138. as long as ONEADAY.EXE, ONEADAY.DOC, and OAD.BAT are contained in the
  139. archive, and they are unmodified in any way.  You use this program at
  140. your own risk, and I guarantee nothing.  I assume no responsibility
  141. for any damage caused by any use of this program.  I have tested this
  142. program on my computers, and it has functioned properly for me.  If
  143. you feel generous, you may send me (a struggling programmer) a check
  144. or money order for $5.00 US currency (or whatever you think is fair)
  145. to the following address:
  146.  
  147.   James J. Murphy
  148.   PAC 0891 - P.O. Box 37301
  149.   Washington, DC 20013
  150.  
  151. You can send me bug reports by CompuServe Mail to User ID: 73750,2304
  152.  
  153.